<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <title>商家登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
    <meta name="author" content="ZhouFeng <a4435351@126.com>">  
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
    <style type="text/css">
    *{margin:0;padding: 0;}
      body{background: #444 url(${base}/plugins/img/carbon_fibre_big.png)}
      .loginBox{width:420px;height:270px;padding:0 20px;border:1px solid #fff; color:#000; margin-top:40px; border-radius:8px;background: white;box-shadow:0 0 15px #222; background: -moz-linear-gradient(top, #fff, #efefef 8%);background: -webkit-gradient(linear, 0 0, 0 100%, from(#f6f6f6), to(#f4f4f4));font:11px/1.5em 'Microsoft YaHei' ;position: absolute;left:50%;top:50%;margin-left:-210px;margin-top:-115px;}
      .loginBox h2{height:45px;font-size:20px;font-weight:normal;}
      .loginBox .left{border-right:1px solid #ccc;height:100%;padding-right: 20px; }
      .span7{float:left; width:60%;}
      .span5{float:left; width:30%; margin-left:20px;}
    </style>  
  </head>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
	<!-- <link class="bootstrap library" rel="stylesheet" type="text/css" href="${base}/plugins/bootstrap/css/bootstrap.min.css"> -->
	<link id="bootstrapCss" rel="stylesheet" href="${base}/plugins/zui/css/zui.css" />
	<script class="bootstrap library" src="${base}/plugins/jquery.js" type="text/javascript"></script>
	<script class="bootstrap library" src="${base}/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	
	<script id="bootstrapJs" type="text/javascript" src="${base}/plugins/zui/js/zui.js"></script>
  </head>
  <body>
    <div class="container">
        <div class="loginBox row-fluid">
          <div class="span7 left">
          <form action="${base}/loginAction" method="post" id="loginform">
            <h2>用户登录</h2>
            <p><input  type="text" value="developer"  class="form-control" name="user.account" placeholder="用户名" /></p>
            <p><input type="password" value="passw0rd"  class="form-control" name="user.password"  placeholder="密码" /></p>
            <div class="row-fluid">
              <div class="span8 lh30"><label><input  type="checkbox" name="rememberme" />下次自动登录</label></div>
          <div class="span1"><input type="submit" value=" 登录 " class="btn btn-primary"></div>
            </div>
            </form>
          </div>
          <div class="span5 right">
            <h2>没有帐户？</h2>
            <div>
              <p>新购买本公司产品用户，请先注册，谢谢！</p>
              <p><a href="${base}/registerIndex"  class="btn">注册</a></p>
            </div>
          </div>
        </div><!-- /loginBox -->
    </div> <!-- /container -->
  </body>
  <script type="text/javascript">
  	$(function(e){
  		$("#loginform").on("submit",function(e){
  			
  			if(!$("input[name='user.account']").val()){
  				var msg = new $.Messager("请输入帐号！",{type:'warning',placement:'bottom'});
			        msg.show();
			        return false;
  			}
  			if(!$("input[name='user.password']").val()){
  				var msg = new $.Messager("请输入密码！",{type:'warning',placement:'bottom'});
			        msg.show();
			        return false;
  			}
  			
  			
  			
  			$.ajax({
  				url:$('#loginform').attr('action'),
  				dataType:'json',
  				data:$("#loginform").serialize(),
  				type:'post',
  				success :function(data){
  					if(data.flag){
  						location.href = "${base}/loginSuccess";
  					}else{
  						var msg = new $.Messager(data.msg,{type:'warning',placement:'bottom'});
  				        msg.show();
  						//alert(data.msg);
  					}
  				}
  			})
  			return false;
  		})
  	})
  </script>
</html>
